﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entity;
using DAL;

namespace BLL
{
    public class MoneyService
    {
        private MoneyDAL moneyDAL = new MoneyDAL();

        public void CreateBuget(BoMoney buget)
        {
            buget.MON_TYPE = 0;
            moneyDAL.Insert(buget);
        }

        public void CreateSubmit(BoMoney buget)
        {
            buget.MON_TYPE = 1;
            moneyDAL.Insert(buget);
        }

        public void UpdateMoney(BoMoney buget)
        {
            moneyDAL.Update(buget);
        }

        public void DeleteMoney(BoMoney buget)
        {
            moneyDAL.Delete(buget.MON_ID);
        }

        public BoMoney GetMoney(string id)
        {
            return moneyDAL.GetModel(id);
        }

        public IList<BoMoney> GetContestMoney(BoContests contest, int moneyType)
        {
            return moneyDAL.GetContestMoney(contest.CON_ID, moneyType);
        }
    }
}
